/* 色彩变量定义 */
:root {
  --primary-color: #FFD166; /* 暖黄色 */
  --secondary-color-1: #06D6A0; /* 薄荷绿 */
  --secondary-color-2: #118AB2; /* 浅湖蓝 */
  --accent-color: #EF476F; /* 珊瑚粉 */
  --background-color: #FAFAFA; /* 浅灰白色 */
  --neutral-color: #9E9E9E; /* 浅灰色 */
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: '微软雅黑', 'Microsoft YaHei', 'Comic Sans MS', 'Marker Felt', sans-serif;
  background-color: var(--background-color);
  color: #333;
  line-height: 1.5;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* 头部样式 */
.header {
  background-color: var(--primary-color);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2rem;
  color: #333;
}

/* 主内容区域 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 学习展示区域 */
.learning-section {
  background-color: white;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.word-display {
  margin-bottom: 30px;
}

.chinese-word {
  font-size: 20rem;
  color: var(--secondary-color-1);
  margin-bottom: 15px;
  font-weight: bold;
}

/* Color selector styles */
.color-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.color-card {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ddd;
  transition: transform 0.2s, border-color 0.2s;
}

.color-card:hover {
  transform: scale(1.1);
}

.color-card.active {
  border-color: #333;
  transform: scale(1.1);
}

.pinyin {
  font-size: 3rem;
  color: var(--secondary-color-2);
  font-weight: 500;
}

/* Audio button styles */
.pinyin-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.audio-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background-color 0.3s;
  display: none; /* Hidden by default */
}

.audio-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.audio-btn:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .pinyin-container {
    gap: 15px;
  }
  
  .audio-btn {
    font-size: 1.5rem;
  }
}

.progress {
  font-size: 1.2rem;
  color: var(--secondary-color-2);
  margin-bottom: 25px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
  padding: 15px 25px;
  font-size: 1.1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  min-height: 60px; /* 确保适合幼儿手指触摸 */
  font-family: inherit;
  font-weight: 500;
}

.prev-btn {
  background-color: var(--primary-color);
  color: #333;
}

.prev-btn:hover {
  background-color: #f0c250; /* 加深10% */
  transform: scale(1.05);
}

.prev-btn:active {
  background-color: #e0b340; /* 加深20% */
  transform: scale(0.98);
}

.next-btn {
  background-color: var(--accent-color);
  color: white;
}

.next-btn:hover {
  background-color: #e03a60; /* 加深10% */
  transform: scale(1.05);
}

.next-btn:active {
  background-color: #c22e50; /* 加深20% */
  transform: scale(0.98);
}

.shuffle-btn {
  background-color: var(--primary-color);
  color: #333;
}

.shuffle-btn:hover {
  background-color: #f0c250; /* 加深10% */
  transform: scale(1.05);
}

.shuffle-btn:active {
  background-color: #e0b340; /* 加深20% */
  transform: scale(0.98);
}

.add-btn {
  background-color: var(--accent-color);
  color: white;
  padding: 12px 20px;
  min-height: 50px;
}

.add-btn:hover {
  background-color: #e03a60; /* 加深10% */
}

.add-btn:active {
  background-color: #c22e50; /* 加深20% */
}

.add-first-btn {
  background-color: var(--accent-color);
  color: white;
  padding: 15px 30px;
  font-size: 1.1rem;
  min-height: 60px;
}

.add-first-btn:hover {
  background-color: #e03a60; /* 加深10% */
  transform: scale(1.05);
}

.add-first-btn:active {
  background-color: #c22e50; /* 加深20% */
  transform: scale(0.98);
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 1.3rem;
  color: var(--neutral-color);
  margin-bottom: 30px;
}

/* 添加生词表单 */
.add-section {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.default-vocab-section {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.default-vocab-btn {
  background-color: var(--secondary-color-1);
  color: white;
}

.default-vocab-btn:hover {
  background-color: #05c492;
}

.clear-all-btn {
  background-color: var(--neutral-color);
  color: white;
}

.clear-all-btn:hover {
  background-color: #8a8a8a;
}

.form-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

#chineseInput {
  flex: 1;
  min-width: 200px;
  padding: 15px;
  font-size: 1.1rem;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  font-family: inherit;
  min-height: 50px;
}

#chineseInput:focus {
  outline: none;
  border-color: var(--secondary-color-1);
  box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  .header h1 {
    font-size: 1.8rem;
  }
  
  .chinese-word {
    font-size: 10rem;
  }
  
  .pinyin {
    font-size: 1.5rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .form-group {
    flex-direction: column;
  }
  
  #chineseInput {
    min-width: auto;
  }
}

/* 生词列表区域 */
.word-list-section {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.word-list-section h2 {
  color: var(--secondary-color-1);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

/* 生词卡片 */
.word-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary-color);
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.word-card-content {
  display: flex;
  flex-direction: column;
}

.word-card-chinese {
  font-size: 1.8rem;
  color: var(--secondary-color-1);
  font-weight: bold;
}

.word-card-pinyin {
  font-size: 1.2rem;
  color: var(--secondary-color-2);
}

.word-card-actions {
  display: flex;
  gap: 8px;
}

.delete-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.3s;
  min-height: 40px;
}

.delete-btn:hover {
  background-color: #e03a60;
}

.delete-btn:active {
  background-color: #c22e50;
}

/* 编辑拼音按钮 */
.edit-pinyin-btn {
  background-color: var(--secondary-color-2);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.3s;
  min-height: 40px;
}

.edit-pinyin-btn:hover {
  background-color: #0f7a9d;
}

.edit-pinyin-btn:active {
  background-color: #0d6a8a;
}

/* 响应式设计 */

/* 动画效果 */
.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  animation: fadeOutDown 0.3s ease forwards;
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* 拼音编辑模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

.modal-content h2 {
  color: var(--secondary-color-1);
  margin-bottom: 20px;
  text-align: center;
}

.close {
  color: var(--neutral-color);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 10px;
}

.close:hover,
.close:focus {
  color: var(--accent-color);
}

.word-preview {
  text-align: center;
  margin-bottom: 20px;
}

.chinese-preview {
  font-size: 3rem;
  color: var(--secondary-color-1);
  font-weight: bold;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

#pinyinInput {
  width: 100%;
  padding: 12px 15px;
  font-size: 1.1rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-family: inherit;
}

#pinyinInput:focus {
  outline: none;
  border-color: var(--secondary-color-1);
  box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.cancel-btn {
  background-color: var(--neutral-color);
  color: white;
  padding: 12px 25px;
  min-height: 50px;
}

.cancel-btn:hover {
  background-color: #8a8a8a;
}

.save-btn {
  background-color: var(--accent-color);
  color: white;
  padding: 12px 25px;
  min-height: 50px;
}

.save-btn:hover {
  background-color: #e03a60;
}
